//
//  SearchHeadView.m
//  DoctorFAQs
//
//  Created by zjq on 17/2/13.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "SearchHeadView.h"

@implementation SearchHeadView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initlizeInterface];
    }
    return self;
}

- (void)initlizeInterface {
    UILabel * nameLabel = [[UILabel alloc] init];
    nameLabel.text = @"搜索历史";
    nameLabel.textAlignment = NSTextAlignmentLeft;
    nameLabel.textColor = KHColorFromRGB(0x999999);
    _deleteAllBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [_deleteAllBtn setTitle:@"清除" forState:UIControlStateNormal];
    [_deleteAllBtn setTitleColor:KHColorFromRGB(0x999999) forState:UIControlStateNormal];
    [self addSubview:nameLabel];
    [self addSubview:_deleteAllBtn];
    
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15*xsIZE);
        make.centerY.equalTo(self);
        make.width.equalTo(self).multipliedBy(0.5);
        make.height.offset(20*ysIZE);
    }];
    [_deleteAllBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-15*xsIZE);
        make.centerY .equalTo(nameLabel);
        make.height.equalTo(nameLabel);
        make.width.offset(40*xsIZE);
    }];
    
}
@end
